/*
 * DownloadInfo.h
 *
 *  Created on: 20.09.2012
 *      Author: Sergey
 */

#ifndef DOWNLOADINFO_H_
#define DOWNLOADINFO_H_

#include <QString>
#include <QObject>

class Download: public QObject {
	Q_OBJECT

	int id;
	QString name;
	QString savingPath;
	QString downloadLink;
	int progress;
	int priority;
	bool finished;
	bool started;

	static int downloadsCounter;

public:
	Download(QString name, QString savingPath,
				 QString downloadLink, int priority,
				 int id = ++downloadsCounter,
				 bool finished = false,
				 bool started = false,
				 int progress = 0);
	static int getDownloadsCounter();
	static void setDownloadsCounter(int downloadsCounter);

	int getId();
	void setId(int id);

	QString getName();
	void setName(QString name);

	QString getSavingPath();
	void setSavingPath(QString savingPath);

	QString getDownloadLink();
	void setDownloadLink(QString downloadLink);

	int getProgress();

	int getPriority();
	void setPriority(int priority);

	bool isFinished();
	void setFinished(bool finished);

	bool isStarted();
	void setStarted(bool started);

	bool isRunning();

	void start();
	void stop();

public slots:
	void setProgerss(int progress);
	void finish();

signals:
	void canceled();
};

#endif /* DOWNLOADINFO_H_ */
